<!--{template header}-->
<!--{template cp_header}-->

<div id="content" class="c_form">
<!--{if empty($_GET['op'])}-->	

	<div class="c_mgs"><div class="ye_r_t"><div class="ye_l_t"><div class="ye_r_b"><div class="ye_l_b">
	<table cellspacing="0" cellpadding="0" class="formtable">
		<caption>
			<h2>我的个人概括</h2>
		</caption>
		<tr><th width="30%">目前您的积分数</th><td><span style="color:red;font-size:20px;font-weight:bold;">$space[credit]</span> <!--{eval echo getstar($space[credit]);}--> (<a href="network.html?ac=space&view=credit">查看排名</a>)</td></tr>
		<tr><th width="30%">积分图标说明</th><td style="padding:0 0 10px 0;line-height:180%;">
			积分每满 <strong>$_SCONFIG[starcredit]</strong> 个，就会拥有一个初级图标 <img src="image/star_level1.gif" align="absmiddle"><br>
			每满 <strong>$_SCONFIG[starlevelnum]</strong> 个当前图标就升级为 <strong>1</strong> 个上级图标<br>
			图标等级由高到低为：<!--{eval for($i=1;$i<11;$i++){}--><img src="image/star_level{$i}.gif"><!--{eval }}--></td></tr>
		<tr><th>所在的用户组</th><td><span<!--{eval g_color($space[groupid]);}-->>$space[grouptitle]</span><!--{eval g_icon($space[groupid]);}--></td></tr>
		<tr><th>访问量</th><td>$space[viewnum] (<a href="network.html?ac=space&view=viewnum">查看排名</a>)</td></tr>
		<tr><th>创建时间</th><td><!--{date('Y-m-d',$space[dateline],1)}--></td></tr>
		<tr><th>上次登录</th><td><!--{date('Y-m-d',$space[lastlogin],1)}--></td></tr>
		<tr><th>最后更新</th><td><!--{date('Y-m-d',$space[updatetime],1)}--></td></tr>

		<tr>
			<th>空间容量</th>
			<td> 最大空间 $maxattachsize, 已用 $space[attachsize] ({$percent}%)</td>
		</tr>
		<!--{if $space[haveattachsize]}--><tr><th>剩余空间</th><td>$space[haveattachsize]</td></tr><!--{/if}-->
	</table>
	</div></div></div></div></div>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分增加的规则</h2>
		<p>以下操作会使你的积分增加</p>
	</caption>
	<tr><th width="30%">发布日志</th><td>+ $get[blog]</td></tr>
	<tr><th>上传图片</th><td>+ $get[pic]</td></tr>
	<tr><th>发布评论/留言</th><td>+ $get[comment]</td></tr>
	<tr><th>发起话题</th><td>+ $get[thread]</td></tr>
	<tr><th>发布回帖</th><td>+ $get[post]</td></tr>
	<tr><th>邀请好友注册成功</th><td>+ $get[invite]</td></tr>
	<tr><th>参与有奖活动</th><td>+ 增加活动奖励积分</td></tr>
	</table>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分减少的规则</h2>
		<p>以下操作会扣减你的积分</p>
	</caption>
	<tr><th width="30%">日志被删除</th><td>- $pay[blog]</td></tr>
	<tr><th>图片被删除</th><td>- $pay[pic]</td></tr>
	<tr><th>评论/留言被删除</th><td>- $pay[comment]</td></tr>
	<tr><th>话题被删除</th><td>- $pay[thread]</td></tr>
	<tr><th>回帖被删除</th><td>- $pay[post]</td></tr>
	<tr><th>获取注册邀请码</th><td>- $pay[invite]</td></tr>
	<tr><th>搜索一次</th><td>- $pay[search]</td></tr>
	<tr><th>增加1M的上传空间</th><td>- $pay[attach]</td></tr>
	<tr><th>日志导入</th><td>- $pay[xmlrpc]</td></tr>
	</table>

	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>用户组与积分对应关系</h2>
		<p>用户组越高，所拥有的权限会越多</p>
	</caption>
	<tr><th width="30%">用户组名</th><td>积分范围</td></tr>
	<!--{loop $groups $value}-->
	<tr><th>$value[grouptitle]</th><td>$value[creditlower] ~ $value[credithigher]</td></tr>
	<!--{/loop}-->
	</table>

<!--{elseif $_GET['op'] == 'exchange'}-->

	<form method="post" action="cp.html?ac=credit&op=exchange">
	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>积分兑换</h2>
		<p>您可以将自己的积分兑换到本站其他的应用（比如论坛）里面。</p>
	</caption>
	<tr><th width="30%">目前您的积分数</th><td> $space[credit]</td></tr>
	<tr>
		<th><label for="password">密码</label></th>
		<td><input type="password" name="password" class="t_input" /></td>
	</tr>
	<tr>
		<th>支出积分</th>
		<td><input type="text" id="amount" name="amount" value="0" class="t_input" onkeyup="calcredit();" /></td>
	</tr>
	<tr>
		<th>兑换成</th>
		<td>
			<input type="text" id="desamount" value="0" class="t_input" disabled />&nbsp;&nbsp;
			<select name="tocredits" id="tocredits" onChange="calcredit();">
			<!--{loop $_CACHE['creditsettings'] $id $ecredits}-->
				<!--{if $ecredits[ratio]}-->
					<option value="$id" unit="$ecredits[unit]" title="$ecredits[title]" ratio="$ecredits[ratio]">$ecredits[title]</option>
				<!--{/if}-->
			<!--{/loop}-->
			</select>
		</td>
	</tr>
	<tr>
		<th>兑换比率</th>
		<td><span class="bold">1</span>&nbsp;<span id="orgcreditunit">积分</span><span id="orgcredittitle"></span>&nbsp;兑换&nbsp;<span class="bold" id="descreditamount"></span>&nbsp;<span id="descreditunit"></span><span id="descredittitle"></span></td>
	</tr>
	<tr><th>&nbsp;</th><td><input type="submit" name="exchangesubmit" value="兑换积分" class="submit"></td></tr>
	</table>
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	</form>
	<script type="text/javascript">
		function calcredit() {
			tocredit = $('tocredits')[$('tocredits').selectedIndex];
			$('descreditunit').innerHTML = tocredit.getAttribute('unit');
			$('descredittitle').innerHTML = tocredit.getAttribute('title');
			$('descreditamount').innerHTML = Math.round(1/tocredit.getAttribute('ratio') * 100) / 100;
			$('amount').value = $('amount').value.toInt();
			if($('amount').value != 0) {
				$('desamount').value = Math.floor(1/tocredit.getAttribute('ratio') * $('amount').value);
			} else {
				$('desamount').value = $('amount').value;
			}
		}
		String.prototype.toInt = function() {
			var s = parseInt(this);
			return isNaN(s) ? 0 : s;
		}
		calcredit();
	</script>
<!--{elseif $_GET['op'] == 'addsize'}-->
		
	<form method="post" action="cp.html?ac=credit&op=addsize">
	<table cellspacing="0" cellpadding="0" class="formtable">
	<caption>
		<h2>兑换容量</h2>
		<p>可以使用自己的积分来兑换附件容量，上传更多的图片。</p>
	</caption>
	<tr><th width="30%">附件空间使用</th><td> 已用 $space[attachsize] / $maxattachsize ，使用比例 {$sizewidth}%
		<table cellspacing="0" cellpadding="0" width="100%"><tr><!--{if $sizewidth}--><td width="{$sizewidth}%" bgcolor="red">&nbsp;</td><!--{/if}--><td bgcolor="green">&nbsp;</td></tr></table>
		</td></tr>
	<tr><th>拥有的积分</th><td>$space[credit]</td></tr>
	<tr><th>兑换规则</th><td>兑换1M的上传空间，需要积分数: $pay[attach]</td></tr>
	<tr><th>要兑换的空间大小</th><td><input type="text" name="addsize" value="1" size="5"> M</td></tr>
	<tr><th>&nbsp;</th><td><input type="submit" name="addsizesubmit" value="兑换" class="submit"></td></tr>
	</table>
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	</form>

<!--{/if}-->

</div>
<div id="sidebar" style="width:150px;">
	<div class="cat">
	<h3>积分操作</h3>
	<ul class="post_list line_list">
		<li<!--{if !$_GET[op]}--> class="current"<!--{/if}-->><a href="cp.html?ac=credit">我的积分</a></li>
		<li<!--{if $_GET[op]=='addsize'}--> class="current"<!--{/if}-->><a href="cp.html?ac=credit&op=addsize">兑换上传容量</a></li>
		<li<!--{if $_GET[op]=='exchange'}--> class="current"<!--{/if}-->><a href="cp.html?ac=credit&op=exchange">积分兑换</a></li>
		<li><a href="network.html?ac=space&view=credit">积分排行榜</a></li>
	</ul>
	</div>
</div>
<!--{template footer}-->
